package com.hqq.behaviour.template_method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * StealingMethod
 * Created by heqianqian on 2017/6/19.
 */
public abstract class StealingMethod {

    private static final Logger LOGGER = LoggerFactory.getLogger(StealingMethod.class);

    public StealingMethod() {
    }

    public abstract String pickTarget();

    public abstract void confuseTarget(String target);

    public abstract void stealTheItem(String target);

    public void steal() {
        String target = pickTarget();
        LOGGER.info("The target has been chosen as {}.", target);
        confuseTarget(target);
        stealTheItem(target);
    }
}
